import React, { Component } from 'react'

import {connect} from 'react-redux'

@connect(
  state => ({
    items: state.cart.items
  })
)

class Cart extends Component {
  render() {
    return (
      <ul>
        {
          this.props.items.map(v => <li key={v.id}>{v.name} - {v.quantity}</li>)
        }
      </ul>
    )
  }
}

export default Cart